Feature: Get Alliance Info API

  # Author: Mariac
  # Execution&Update History
  # |Date       |Owner           |Update/Execution Remark         |Comments                          |
  # |03/09/2016 |Maria Chen      |First Draft                     |                                  |
  Background: 
    Given these Alliances:
      | allianceId |
      | Gro21010   |

  @happy
  Scenario: Request contains valid allianceId - verify the alliance info
    When I send a GET request to "alliance/Gro21010"
    Then the response status should be 200
    And the JSON response should be
      """
      {
      "allianceId": "Gro21010",
      "partnerName": "Group Health",
      "productLines": [
      "HSA",
      "IFP",
      "MA"
      ]
      }
      """

  @sad
  Scenario: AllianceId not passed in URL
    When I send a GET request to "alliance/"
    Then the response status should be 404
    And the error type should be "RESOURCE_NOT_FOUND"
    And the error message should be "Resource doesn't exist"

  @sad
  Scenario: AllianceId exist in Oracle but not belongs to iStore
    When I send a GET request to "alliance/jet90000"
    Then the response status should be 400
    And the error type should be "PARAMETER_INVALID"
    And the error message should be "iStore not support the allianceId: jet90000"

  @sad
  Scenario: AllianceId doesn't exist in Oracle DB
    When I send a GET request to "alliance/test1234"
    Then the response status should be 200
    And the JSON response should be
      """
      {}
      """
